package com.pzl.arcgis;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.view.MapView;

public class MainActivity extends AppCompatActivity {

    MapView mapView;

    Button btn_renderer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btn_renderer = (Button) findViewById(R.id.btn_renderer);

        mapView = (MapView) findViewById(R.id.mapView);
        ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);
        mapView.setMap(map);
    }

    @Override
    protected void onPause() {
        mapView.pause();
        super.onPause();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mapView.resume();
    }

    public void click(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.btn_renderer:
                intent.setClass(this, RendererActivity.class);
                break;
            case R.id.btn_symbols:
                intent.setClass(this, SymbolsActivity.class);
                break;
            case R.id.btn_imageLayerUrl:
                intent.setClass(this, ImageLayerActivity.class);
                break;
            case R.id.btn_TiledLayerURL:
                intent.setClass(this, TiledLayerURLActivity.class);
                break;
            case R.id.btn_CreateGeometries:
                intent.setClass(this, CreateGeometriesActivity.class);
                break;
        }
        startActivity(intent);
    }

}
